package com.hfh.io.exer;

import org.junit.Test;

import java.io.*;

public class Exer2 {
    @Test
    public void test(){
        try(InputStream is = new FileInputStream("file/最后的人.mp4");
            OutputStream os = new FileOutputStream("file/new.mp4")){
            byte[] arr = new byte[1024];
            int len;
            while ((len=is.read(arr))!=-1){
                os.write(arr,0,len);
                os.flush();
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
